In [1]:
"Hola Mundo".upper()
Out[1]:
In [2]:
"Hola Mundo".lower()
Out[2]:
In [3]:
"hola mundo".capitalize()
Out[3]:
In [4]:
"hola mundo".title()
Out[4]:
In [5]:
"Hola mundo".count('mundo')
Out[5]:
In [6]:
"Hola mundo".find('mundo')
Out[6]:
In [7]:
"Hola mundo".find('mundoz')
Out[7]:
In [10]:
"Hola mundo mundo mundo".rfind('mundo')
Out[10]:
In [11]:
c = "100"
In [12]:
c.isdigit()
Out[12]:
In [17]:
c2 = "ABC10034po"
In [18]:
c2.isalnum()
Out[18]:
In [22]:
c2.isalpha()
Out[22]:
In [24]:
"Holamundo".isalpha()
Out[24]:
In [25]:
"Hola mundo".islower()
Out[25]:
In [26]:
"Hola mundo".isupper()
Out[26]:
In [30]:
"Hola Mundo".istitle()
Out[30]:
In [32]:
" - ".isspace()
Out[32]:
In [35]:
"Hola mundo".startswith("Mola")
Out[35]:
In [37]:
"Hola mundo".endswith('mundo')
Out[37]:
In [41]:
"Hola mundo mundo".split()[0]
Out[41]:
In [42]:
"Hola,mundo,mundo,otra,palabra".split(',')
Out[42]:
In [44]:
",".join("Hola mundo")
Out[44]:
In [45]:
" ".join("Hola")
Out[45]:
In [9]:
" Hola mundo ".strip()
Out[9]:
In [47]:
"-----Hola mundo---".strip('-')
Out[47]:
In [10]:
"Hola mundo".replace('o','0')
Out[10]:
In [52]:
"Hola mundo mundo mundo mundo mundo".replace(' mundo','',4)
Out[52]: